package com.example.demo01;

import java.util.concurrent.locks.ReentrantLock;

/**
 * description: StringDemo <br>
 * date: 2021/1/26 14:23 <br>
 *
 * @author: ZhangYixin <br>
 * version: 1.0 <br>
 */
public class StringDemo {
    public static void main(String[] args) {
        String str1 = new String("application");
        String str2 = "application";
        String str3 = "application";
        String str4 = "appli"+"cation";
        String str5 = str1+"net";
        String str6 = "application"+"net";
        String str7 = "net";
        String str8 = str1+str7;
        String str9 = "application"+str7;

        System.out.println(str1==str2);
        System.out.println(str2==str3);
        System.out.println(str1 == str4);
        System.out.println(str2 == str4);
        System.out.println("--------------------------");
        System.out.println(str5=="applicationnet");
        System.out.println(str6=="applicationnet");
        System.out.println(str8=="applicationnet");
        System.out.println(str9=="applicationnet");

    }
}
